package com.xsoft.logic.service.implement;


import java.util.List;

import com.xsoft.framework.service.BaseService;
import com.xsoft.logic.dao.UserDao;
import com.xsoft.logic.model.DevUsers;
import com.xsoft.logic.service.interfaces.UserService;

public class UserServiceImpl extends BaseService implements UserService
{
	UserDao userDao;

	public UserDao getUserDao()
	{
		return userDao;
	}

	public void setUserDao(UserDao userDao)
	{
		this.userDao = userDao;
	}

	@Override
	public DevUsers getUserByNameAndPassword(String name,String password)
	{
		// TODO Auto-generated method stub
		return userDao.getUserByNameAndPassword(name,password);
	}

	@Override
	public void save(DevUsers vo)
	{
		userDao.save(vo);
	}

	@Override
	public boolean hasUserByName(String name)
	{
		List list = userDao.find(" from DevUsers where devname=? ", new Object[]{name});
		
		return (list.size()==0);
	}
	

}
